In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
Notice: task description has been slightly modified with regard to original version from competition, to allow sending programs instead of output files.
We are given a sequence of positive integers (for ). This sequence is used to encrypt -bit messages. If we have a message consisting of consecutive bits() ( is either or ), then its encryption it the number:
You are given encrypted messages and sequences of numbers (), that have been used to encrypt the messages. Your task is to decrypt the encrypted messages and to save them in particular files. You are not expected to present any program. It is sufficient that you write the decrypted messages.
In the first line of the standard input there is one integer , . In the successive lines there is a sequence of numbers () written: in the line of number there is one positive integer . The sum of the numbers does not exceed . In the line of number there is one integer - the encrypted message, .
In the first line of standard output you should write the successive numbers , without any spaces between them. The test data were chosen so that the encrypted messages are unambiguously determined.
For the input data:
24 19226985 123697 67356296 19721773 1113273 69335448 23680077 9029881 85168664 93676782 5253843 77616588 78572630 13375812 17199980 101508862 59248276 3505733 35790095 62028546 85726819 56462819 103373994 91757169 667509506
the correct result is:
110001000101101100010101
Task author: Wojciech Guzicki.